<template>
  <!-- <el-button type='info' @click='logout'>退出</el-button> -->
  <el-container class="home-container">
    <el-header>
    
      <div><p>测试管理平台</p></div>
        <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect"
          background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" :router="true">
          <el-submenu index="/user">
            <template slot="title">用户管理</template>
            <el-menu-item index="users">用户列表</el-menu-item>
          </el-submenu>
          <el-submenu index="interface">
            <template slot="title">接口管理</template>
            <el-menu-item index="interfaces">接口列表</el-menu-item>
          </el-submenu>

        </el-menu>
        <!-- <div><el-button type='info' @click='logout'>退出</el-button></div> -->
      <div><el-button type='info' @click='logout'>退出</el-button></div>

    </el-header>
    <el-main>
      <!-- 路由占位符 -->
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
  export default {
    data() {
      return {
        activeIndex: '1',
        activeIndex2: '1'
      }
    },
    methods: {
      logout() {
        window.sessionStorage.clear();
        this.$router.push('/login');
      },
      handleSelect(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  };
</script>

<style lang="less" scoped>
  .home-container {
    height: 100%;
  }

  .el-header {
    background-color: #373d41;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 20px;
  }

  .el-main[data-v-03062dc1] {
    background-color: #f7f7f7;
  }
</style>
